<template>
  <div class="app-container">
    <!--区域数据-->

    <el-col :span="24" style="height: 100%;background-color: #FFFFFF;padding: 10px;">
      <el-row style="height: 50%;">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
          <el-form-item label="用户编号" prop="userId">
            <el-input v-model="queryParams.userId" placeholder="请输入用户编号" clearable @keyup.enter.native="handleQuery" />
          </el-form-item>
          <el-form-item label="用户名称" prop="userName">
            <!-- <el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable @keyup.enter.native="handleQuery" /> -->
            <el-select filterable clearable v-model="queryParams.userName" placeholder="请选择用户名称" style="width: 100%">
                <el-option
                  v-for="dept in userOption"
                  :key="dept.id"
                  :label="dept.userName"
                  :value="dept.userName"
                ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="日期" prop="readDate">
            <!-- <el-date-picker v-model="queryParams.readDate" value-format="yyyy-MM" type="month" placeholder="请选择">
            </el-date-picker> -->
             <el-date-picker v-model="queryParams.readDate" type="monthrange" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份">
             </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
            <el-button type="primary" icon="el-icon-bank-card" :disabled="multiple" size="mini" @click="batchJiezhang">批量结账</el-button>
            <RightDropdown
                :columns="columns"
                :showSearch.sync="showSearch"
                :tableVisible="false"
                :queryVisible="false"
                @queryTable="getList"
                @export="handleExport"
                :hasPermiExport="['datastatistics:bill:export']"
                style="margin-left: 10px"
              ></RightDropdown>
          </el-form-item>
        </el-form>
        <!-- 日期、用户编号、用户名称、金额、延期金额、状态（是否结算）、操作 结账 -->
        <el-table v-loading="loading" :data="billList" height="calc(100% - 103px)" @selection-change="handleSelectionChange"
          @row-click="tableRowClick" :row-style="rowStyle">
          <el-table-column type="selection" width="55" align="center" :selectable="checkboxSelectable"/>
          <el-table-column type="index" align="center" width="50" label="序号"></el-table-column>

          <el-table-column label="冻结月" align="center" prop="readDate" />

          <el-table-column label="日期" align="center" prop="freezeDate" min-width="300" show-overflow-tooltip />
          <el-table-column label="用户编号" align="center" prop="userId" :show-overflow-tooltip="true" />
          <el-table-column label="用户名称" align="center" prop="userName" :show-overflow-tooltip="true" />

          <el-table-column label="水单价" align="center" prop="unitPriceW" >
            <template slot-scope="scope">
              {{  formatToDecimals(scope.row.unitPriceW, 4) }}
            </template>
          </el-table-column>
          <el-table-column label="电单价" align="center" prop="unitPriceE" >
            <template slot-scope="scope">
              {{  formatToDecimals(scope.row.unitPriceE, 4) }}
            </template>
          </el-table-column>
          <el-table-column label="水用量" align="center" prop="countW" >
            <template slot-scope="scope">
              {{  formatToDecimals(scope.row.countW, 4) }}
            </template>
          </el-table-column>
           <el-table-column label="电用量" align="center" prop="countE" >
            <template slot-scope="scope">
              {{  formatToDecimals(scope.row.countE, 4) }}
            </template>
          </el-table-column>
           <el-table-column label="水公摊用量" align="center" prop="countPubW" min-width="100">
            <template slot-scope="scope">
              {{  formatToDecimals(scope.row.countPubW, 4) }}
            </template>
          </el-table-column>
           <el-table-column label="电公摊用量" align="center" prop="countPubE" min-width="100">
            <template slot-scope="scope">
              {{  formatToDecimals(scope.row.countPubE, 4) }}
            </template>
          </el-table-column>
           <el-table-column label="水费" min-width="100"  align="center" prop="costW" >
            <template slot-scope="scope">
              {{  formatToDecimals(scope.row.costW, 4) }}
            </template>
          </el-table-column>
          <el-table-column label="电费" min-width="100" align="center" prop="costE" >
            <template slot-scope="scope">
              {{  formatToDecimals(scope.row.costE, 4) }}
            </template>
          </el-table-column>
          <el-table-column label="水公摊费用" align="center" prop="costWPub" min-width="100">
            <template slot-scope="scope">
              {{  formatToDecimals(scope.row.costWPub, 4) }}
            </template>
          </el-table-column>
          <el-table-column label="电公摊费用" align="center" prop="costEPub" min-width="100">
            <template slot-scope="scope">
              {{  formatToDecimals(scope.row.costEPub, 4) }}
            </template>
          </el-table-column>
          <el-table-column label="合计金额" min-width="100" align="center" prop="costTotal" >
            <template slot-scope="scope">
              {{  formatToDecimals(scope.row.costTotal, 4) }}
            </template>
          </el-table-column>

          <!-- <el-table-column label="水单价" align="center" prop="unitPriceW" /> -->
          <!-- <el-table-column label="电单价" align="center" prop="unitPriceE" /> -->
          <!-- <el-table-column label="水用量" align="center" prop="countW" /> -->
          <!-- <el-table-column label="电用量" align="center" prop="countE" /> -->
          <!-- <el-table-column label="水公摊用量" align="center" prop="countPubW" /> -->
          <!-- <el-table-column label="电公摊用量" align="center" prop="countPubE" /> -->
          <!-- <el-table-column label="水公摊费用" align="center" prop="costWPub" /> -->
          <!-- <el-table-column label="电公摊费用" align="center" prop="costEPub" /> -->
          <!-- <el-table-column label="水费" align="center" prop="costW" /> -->
          <!-- <el-table-column label="电费" align="center" prop="costE" /> -->
          <!-- <el-table-column label="合计金额" align="center" prop="costTotal" /> -->

          <!-- <el-table-column label="类型" align="center" prop="usageType" >
            <template slot-scope="scope">
              <dict-tag :options="dict.type.usage_type" :value="scope.row.usageType"/>
            </template>
          </el-table-column>
          <el-table-column label="单价" align="center" prop="unitPrice" >
            <template slot-scope="scope">
              {{  formatToDecimals(scope.row.unitPrice, 4) }}
            </template>
          </el-table-column>
          <el-table-column label="总量" align="center" prop="totalVal" >
            <template slot-scope="scope">
              {{  formatToDecimals(scope.row.totalVal, 4) }}
            </template>
          </el-table-column> -->

          <!-- <el-table-column label="金额" align="center" prop="totalPrice" >
            <template slot-scope="scope">
              {{  formatToDecimals(scope.row.totalPrice, 4) }}
            </template>
          </el-table-column>
          <el-table-column label="延期金额" align="center" prop="lateFee" >
             <template slot-scope="scope">
              {{  formatToDecimals(scope.row.lateFee, 4) }}
            </template>
          </el-table-column>
          <el-table-column label="状态" align="center" prop="status" >
            <template slot-scope="scope">
              <dict-tag :options="dict.type.bill_status" :value="scope.row.status"/>
            </template>
          </el-table-column> -->
          <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="50">
            <template slot-scope="scope">
              <el-tooltip effect="dark" content="结账" placement="top">
                <el-button
                    size="mini"
                    type="text" :disabled="scope.row.status"
                    icon="el-icon-bank-card"
                    @click="batchJiezhang(scope.row)"
                >结账
                </el-button>
              </el-tooltip>
            </template>
          </el-table-column>
        </el-table>
        <pagination
          v-show="total>0"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getList"
        />
      </el-row>
      <el-row style="height: 50%;">
        <el-col :span="24" style="height: 100%;background-color: #FFFFFF;padding: 10px;">
        <el-tabs v-model="tabName" type="card" @tab-click="tabClick">
          <el-tab-pane label="用量记录" name="1">
            <!-- 日期、用户编号、表编号、能耗分类、起始读数、结束读数、用量、单价、总价 -->
            <el-table   :key="tabName" v-loading="detailLoading" :data="billDetailList" :height="getAvailableHeight"
            :highlight-current-row = "true">
              <el-table-column type="index" align="center" width="50" label="序号"></el-table-column>
              <el-table-column label="日期" align="center" prop="readDate" />
              <el-table-column label="用户编号" align="center" prop="userId" />
              <el-table-column label="表编号" align="center" prop="terminalId" />
              <el-table-column label="设备名称" align="center" prop="installAddress" />

              <el-table-column label="能耗分类" align="center" prop="energyUseClassification" >
                <template slot-scope="scope">
                  <dict-tag :options="dict.type.energy_use_classification" :value="parseInt(scope.row.energyUseClassification+'')"/>
                </template>
              </el-table-column>
              <el-table-column label="起始读数" align="center" prop="startReading" >
                <template slot-scope="scope">
              {{  formatToDecimals(scope.row.startReading, 2) }}
                </template>
              </el-table-column>
              <el-table-column label="结束读数" align="center" prop="endReading" >
                <template slot-scope="scope">
              {{  formatToDecimals(scope.row.endReading, 2) }}
                </template>
              </el-table-column>
              <el-table-column label="用量" align="center" prop="totalVal" >
                 <template slot-scope="scope">
              {{  formatToDecimals(scope.row.totalVal, 4) }}
                </template>
              </el-table-column>
              <el-table-column label="单价" align="center" prop="unitPrice" >
                 <template slot-scope="scope">
              {{  formatToDecimals(scope.row.unitPrice, 4) }}
                </template>
              </el-table-column>
              <el-table-column label="总价" align="center" prop="totalPrice" >
                 <template slot-scope="scope">
              {{  formatToDecimals(scope.row.totalPrice, 4) }}
                </template>
              </el-table-column>
            </el-table>

            <pagination
              v-show="detailTotal>0"
              :total="detailTotal"
              :page.sync="tabQueryParams.pageNum"
              :limit.sync="tabQueryParams.pageSize"
              @pagination="getDetailList"
            />
          </el-tab-pane>
          <el-tab-pane label="公摊记录" name="2">
            <!-- 日期、能耗分类、公摊项名称、用户编号、公摊系数、公摊项总用量、均摊用量、单价、总价 -->
            <el-table :key="tabName" v-loading="publicShareLoading" :data="publicShareList" :height="getAvailableHeight"
            :highlight-current-row = "true">
              <el-table-column type="index" align="center" width="50" label="序号"></el-table-column>
              <el-table-column label="日期" align="center" prop="reportDate" />
              <el-table-column label="能耗分类" align="center" prop="energyType" >
                <template slot-scope="scope">
                  <dict-tag :options="dict.type.energy_use_classification" :value="scope.row.energyType+''"/>
                </template>
              </el-table-column>
              <el-table-column label="公摊项名称" align="center" prop="publicShareName" :show-overflow-tooltip="true" />
              <el-table-column label="用户编号" align="center" prop="userId" />
              <el-table-column label="公摊系数" align="center" prop="publicShareCoefficient" />
              <el-table-column label="公摊项总用量" align="center" prop="totalAmount" />
              <el-table-column label="均摊用量" align="center" prop="publicShareAmount" />
              <el-table-column label="单价" align="center" prop="price" />
              <el-table-column label="总价" align="center" prop="publicShareCost" />
            </el-table>

            <pagination
              v-show="publicShareTotal>0"
              :total="publicShareTotal"
              :page.sync="tabQueryParams.pageNum"
              :limit.sync="tabQueryParams.pageSize"
              @pagination="getPublicShareList"
            />
          </el-tab-pane>

            <!-- <el-tab-pane disabled>
    <slot slot="label">
        <el-button @click.stop="submit">提交</el-button>
    </slot>
  </el-tab-pane> -->


        </el-tabs>
        <el-button
size="mini"
type="primary"
style="position: absolute; right: 10px; top: 5px;"
@click="handleExportDetail"
>
下载
</el-button>
       <!-- <template #add-icon>
        <RightDropdown
                :columns="columns"
                :showSearch.sync="showSearch"
                :tableVisible="false"
                :queryVisible="false"
                @queryTable="getList"
                @export="handleExportDetail"
                :hasPermiExport="['datastatistics:bill:export']"
                style="margin-left: 10px"
              ></RightDropdown>
      </template>
         -->

        </el-col>

        <!-- <el-col :span="1" style="height: 100%;background-color: #FFFFFF;padding: 10px;">
          <RightDropdown
                :columns="columns"
                :showSearch.sync="showSearch"
                :tableVisible="false"
                :queryVisible="false"
                @queryTable="getList"
                @export="handleExportDetail"
                :hasPermiExport="['datastatistics:bill:export']"
                style="margin-left: 10px"
              ></RightDropdown>
        </el-col> -->
      </el-row>
    </el-col>
  </div>
</template>

<script>
  import { listUsersxbAll } from "@/api/record/usersxb";
  import {publicShareListForBill} from "@/api/basedata/publicShareComsumeReport";
  import {listBill,checkoutBills} from "@/api/datastatistics/bill/bill";
  import {listBillDetail} from "@/api/datastatistics/bill/billDetail";
  import Treeselect from "@riophae/vue-treeselect";
  import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  import moment from "moment/moment";
  export default {
  name: "TotalReport",
  components: {Treeselect},
  dicts: ['bill_status','energy_use_classification','usage_type'],
  data() {
    return {

      userOption:[],
      screenHeight: null,
      // 非多个禁用
      multiple: true,
      tabName:'1',
      // 区域树选项
      sheetsTreeList: [],
      defaultProps: {
        children: "children",
        label: "sheetsName",
      },
      filterText: '',
      treeLoading: false,
      treeWidth: '',
      defaultExpandedKeys: [],

      // 遮罩层
      loading: true,
      detailLoading:true,
      publicShareLoading:true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      detailTotal:0,
      publicShareTotal:0,
      // 表格数据
      billList: [],
      billDetailList:[],
      publicShareList:[],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        tenantId: null,
        sheetsCode:null,
        areaId: null,
        userId: null,
        userName:null,
        //readDate:moment().format("yyyy-MM"),
        readDate: [moment().startOf('month').format("yyyy-MM"), moment().endOf('month').format("yyyy-MM")],
        //readDate:moment().add(-1,'months').format("yyyy-MM"),
      },
      tabQueryParams: {
        userId:null,
        // locationNb:null,
        readDate:null,
        pageNum: 1,
        pageSize: 10,
      },
      // 表单参数
      form: {},
      // 表单校验
      selectedIds:null,
      clickLocationNb:'',
      clickUserId:'',

      clickReadDate:null,
      rowTag:null,
    };
  },
  created() {
    this.getTreeList();
    this.screenHeight = document.body.clientHeight
  },
  watch: {
    filterText(val) {
      this.$refs.tree.filter(val);
    }
  },
  computed: {
    getAvailableHeight() {
      return this.screenHeight/2 - 160
    },
  },
  mounted() {
    this.getUserXbList();
    this.getList();
    this.treeWidth = this.$refs['tree']?.$el.offsetWidth - 15
  },
  methods: {
    formatToDecimals(input,bitNum) {
    if(!input){
      input  =  0
    }
    // 尝试将输入转换为数字
    const num = Number(input);

    // 检查转换是否成功（排除NaN的情况）
    if (isNaN(num)) {
        throw new Error('输入必须是有效的数字或数字字符串');
    }

    // 保留4位小数并补0，返回字符串形式
    return num.toFixed(bitNum);
   },
    getUserXbList(){
     listUsersxbAll().then(response => {
        this.userOption = response.rows;
      })
    },
     /** 导出按钮操作 */
    // handleExport() {
        // let exportParams = { ...this.queryParams };
        // if (Array.isArray(exportParams.readDate)) {
        //     exportParams.readDate = exportParams.readDate.map(date => moment(date).format("yyyy-MM")).join(",");
        // }
        // this.download(
        //   "/datastatistics/bill/exportStat",
        //   {
        //     ...this.exportParams,
        //   },
        //   `付款通知单.xlsx`
        // );
    // },
    /** 导出按钮操作 */
    handleExport() {
      let exportParams = { ...this.queryParams };
      if (Array.isArray(exportParams.readDate)) {
        // 格式化 readDate
        exportParams.readDate = exportParams.readDate.map(date => moment(date).format("yyyy-MM")).join(",");
      }
      this.download(
      "/datastatistics/bill/exportStat",
        {
          // 核心修改：使用本地变量 exportParams
          ...exportParams,
        },
      `付款通知单.xlsx`
      );
    },


     /** 导出按钮操作 */
    handleExportDetail() {
      if(!this.clickUserId){
        this.$message.error("请点击上方开账数据");
        return;
      }

       if(this.tabName === '1'){
        //用量记录
        // this.getDetailList();
        this.download(
          "/datastatistics/billDetail/export",
          {
            ...this.tabQueryParams,
          },
          `用量记录.xlsx`
        );
      }else{
        //公摊记录
        // this.getPublicShareList();
        this.download(
          "/datastatistics/publicShareComsumeReport/exportForBill",
          {
            ...this.tabQueryParams,
          },
          `公摊记录.xlsx`
        );
      }

    },




    rowStyle(e){
      if(e.row.id === this.rowTag){
        return {'background-color':'#f5f7fa', cursor:'pointer'};
      }
      return {cursor:'pointer'};
    },
    checkboxSelectable(row,index){
      return !row.status;
    },
    tableRowClick(row,column, event){
      this.rowTag = row.id;
      // this.clickLocationNb = row.locationNb;
      this.clickUserId = row.userId;

      this.clickReadDate = row.readDate;
      this.reInitTabParams();
      if(this.tabName === '1'){
        //用量记录
        this.getDetailList();
      }else{
        //公摊记录
        this.getPublicShareList();
      }
    },
    //批量结账
    batchJiezhang(row){
      const ids = row.id || this.selectedIds;
      this.$modal.confirm('是否确认结账？').then(function() {
        return checkoutBills(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("结账成功");
      }).catch(() => {});
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.selectedIds = selection.map(item => item.id)
      this.multiple = !selection.length
    },
    tabClick(tab, event) {
      // console.log(tab, event);
      this.reInitTabParams();
      if(!this.clickUserId){
          return;
      }
      if(this.tabName === '1'){
        //用量记录
        this.getDetailList();
      }else{
        //公摊记录
        this.getPublicShareList();
      }
    },
    // 重置tab下的表格查询条件
    reInitTabParams(){
      this.tabQueryParams= {
        // locationNb:this.clickLocationNb,
        userId:this.clickUserId,
        readDate:this.clickReadDate,
        reportDate:this.clickReadDate,
        pageNum: 1,
        pageSize: 10,
      };
    },
    /** 查询区域树 */
    getTreeList() {
      this.treeLoading = true;
      this.sheetsTreeList = JSON.parse(localStorage.getItem('meteredTreeData'))
      if (this.sheetsTreeList.length === 0){
        this.treeLoading = false;
      }else{
        this.defaultExpandedKeys = [this.sheetsTreeList[0].id];
        this.sheetsTreeList.map(item => {
          this.getLeafKeys(item)
        })
        this.treeLoading = false;
      }
    },
    getLeafKeys(node) {
      //判断是否要禁用的条件
      if (node.deviceType === 0 && node.children.length === 0) {
        node.isDisabled = true
      } else {
        node.isDisabled = false
      }
      node.children.forEach(item => this.getLeafKeys(item))
    },
    handleNodeClick(data) {
      // this.queryParams.areaId = data.id;
      this.queryParams.sheetsCode = data.sheetsCode;
      this.handleQuery()
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    // 筛选节点
    filterNode(value, data) {
      if (!value) return true;
      return data.sheetsName.indexOf(value) !== -1;
    },
    /** 转换部门数据结构 */
    normalizer(node) {
      if (node.children && !node.children.length) {
        delete node.children;
      }
      return {
        id: '' + node.id,
        label: node.sheetsName,
        children: node.children,
        isDisabled: node.isDisabled
      };
    },
    // 区域下拉框改变触发事件
    handleSheetsChange(node) {
      this.form.areaId = node.id
    },

    /** 查询公摊配置表列表 */
    getList() {
      this.loading = true;

      let params = { ...this.queryParams };

      if (Array.isArray(params.readDate)) {
        params.readDate = params.readDate.map(date => moment(date).format("yyyy-MM")).join(",")
      }

      listBill(params).then(response => {
        this.billList = response.rows;
        this.total = response.total;
        this.loading = false;
        //下方tab
        if(this.billList.length>0){
          this.tableRowClick(this.billList[0]);
        }else{
          this.clickLocationNb = '';
          this.clickReadDate = null;
          this.detailLoading = false;
          this.publicShareLoading = false;
          this.billDetailList = [];
          this.publicShareList = [];
        }
      });
    },
    getDetailList(){
      listBillDetail(this.tabQueryParams).then(response => {
        this.billDetailList = response.rows;
        this.detailTotal = response.total;
        this.detailLoading = false;
      });
    },
    getPublicShareList(){
      publicShareListForBill(this.tabQueryParams).then(response => {
        this.publicShareList = response.rows;
        this.publicShareTotal = response.total;
        this.publicShareLoading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        tenantId: null,
        areaId: null,
        publicShareName: null,
        energyType: '1',
        reportDate:moment().add(-1,'months').format("yyyy-MM"),
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
  }
};
</script>

<style scoped lang="scss">
// 设置本身箭头为隐藏状态
::v-deep .el-tree-node__expand-icon {
  width: 20px;
  padding: 0;
  margin: 5px 0;

  svg {
    display: none;
    width: 0;
  }
}

// 虚线所需样式
::v-deep .treeCont {
  .el-tree-node {
    width: fit-content;
    min-width: var(--treeWidth);
  }

  .el-tree > .el-tree-node:before {
    //border-top: none;
    padding-left: 0px;
  }

  .el-tree > .el-tree-node:after {
    border-top: none;
  }

  .el-tree-node__content {
    padding-left: 5px !important;
  }

  .el-tree-node__children {
    //overflow: visible !important;

    .el-tree-node {
      position: relative;
      padding-left: 5px;
    }
  }

  //节点有间隙，隐藏掉展开按钮就好了,如果觉得空隙没事可以删掉
  .el-tree-node__expand-icon.is-leaf {
    width: 4px;
  }

  .el-tree-node__children {
    padding-left: 18px;
  }

  .el-tree-node :last-child:before {
    height: 17px;
  }

  .el-tree > .el-tree-node:before {
    border-left: none;
  }

  .el-tree > .el-tree-node:after {
    border-top: none;
    top: 25px;
    width: 0px;
  }

  .el-tree-node:before {
    content: "";
    left: -4px;
    position: absolute;
    right: auto;
    border-width: 1px;
  }

  .el-tree-node:after {
    content: "";
    left: -4px;
    position: absolute;
    right: auto;
    border-width: 1px;
  }

  .el-tree-node:before {
    border-left: 1px dashed #c0c4cc;
    height: 100%;
    top: -3px;
    width: 1px;
  }

  .el-tree-node:after {
    border-top: 1px dashed #c0c4cc;
    height: 0px;
    top: 13px;
    width: 16px;
  }
}

// 默认三角行换成加减号
::v-deep .treeCont {
  .el-tree-node__content > .el-tree-node__expand-icon {
    width: 16px;
    //width: 0px;
    padding: 0px;
    font-size: 16px !important;
    margin-right: 5px; //新增
  }

  .el-tree .el-tree-node__expand-icon.expanded {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }

  //有子节点 且未展开
  .el-tree .el-tree-node__expand-icon:before {
    background: url('../../../../assets/images/jia.png') no-repeat;
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    font-size: 20px;
    background-size: 100% 100%;
  }

  .custom-tree-node .el-icon svg {
    display: block !important;
    color: #000;
  }
  //有子节点 且已展开
  .el-tree .el-tree-node__expand-icon.expanded:before {
    background: url('../../../../assets/images/jian.png') no-repeat;
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    font-size: 20px;
    background-size: 100% 100%;
  }

  //没有子节点
  .el-tree .el-tree-node__expand-icon.is-leaf::before {
    background: none;
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    font-size: 20px;
    background-size: 100% 100%;
  }
}
.form_col {
  width: 80%;

  ::v-deep .el-form {
    width: 100%;
  }

  ::v-deep .el-form-item {
    width: 23%;
  }
}
.form_query {
  width: 20%;
  text-align: right;
}
.el-divider--horizontal{
  margin: 0px !important;
}
</style>
